﻿@model _17bangMVC.Models.ProfileModel
@{
    ViewBag.Title = "Write";

    int[] months = new int[12];
    for (int i = 0; i < 12; i++)
    {
        months[i] = i + 1;
    }
    IDictionary<int, int> years = new Dictionary<int, int>
{
        {1,1980 },
        {2,1981 },
        {3,1982 },
        {4,1983 },
        {5,1984 },
        {6,1985 },
        {7,1986 },
        {8,1987 },
        {9,1988 },
        {10,1989 },
        {11,1990 },
        {12,1991 },
        {13,1992 },
        {14,1993 },
        {15,1994 },
        {16,1995 },
        {17,1996 },
        {18,1997 },
        {19,1998 },
        {20,1999 },
        {21,2000 },
        {22,2001 },
        {23,2002 },
        {24,2003 },
        {25,2004 },
        {26,2005 },
    };
    IDictionary<int, string> constellation = new Dictionary<int, string>
{
        {1,"水瓶座" },
        {2,"白羊座" },
        {3,"双鱼座" },
        {4,"双子座" },
        {5,"巨蟹座" },
        {6,"金牛座" },
        {7,"狮子座" },
        {8,"处女座" },
        {9,"天秤座" },
        {10,"天蝎座" },
        {11,"射手座" },
        {12,"摩羯座" },
    };
    IDictionary<int, string> first = new Dictionary<int, string>
{
        {1,"编程开发语言" },
        {2,"工具软件" },
        {3,"顾问咨询" },
        {4,"操作系统" },
    };
    IDictionary<int, string> second = new Dictionary<int, string>
{
        {1,"C#" },
        {2,"JAVA" },
        {3,"Jacascript" },
        {4,"html" },
        {5,"Python" },
        {6,"SQL" },
        {7,"CSS" },
        {8,"PHP" },
        {9,"C++" },
        {10,"C" },
    };

}
<style>
    .field-validation-error {
        color: red;
        font-size: 12px;
        display: inline-block;
        font: normal normal normal 14px/1 FontAwesome;
        font-size: inherit;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
    }

        .field-validation-error::before {
            content: '\f119';
        }
</style>

<h2><span class="fa fa-user-circle-o">个人资料</span></h2>
<hr />

<div class="container">
    <div class="row" style="padding-top:50px">
        <div class="col-6">
            @using (Html.BeginForm("Write", "Profile", FormMethod.Post, new { enctype = "multipart/form-data" }))
            {
                <label><b>头像：（*仅限jpg/png/gif）</b></label>

                if (Model == null || Model.Icon == null)
                {
                    <input type="file" name="icon" multiple accept="image/*" />
                    @Html.TextBoxFor(m => m.Icon, new
                     {
                         @class = "form-control",
                         placeholder = "页面提交时上传文件"
                     });
                }
                else
                {
                    <img src="@Model.Icon" />
                }

                <br />
                <label>性别：</label>
                <label>
                    @Html.RadioButtonFor(m => m.IsMale, false, new { @checked = string.Empty })男
                </label>
                <label>
                    @Html.RadioButtonFor(m => m.IsMale, true)女
                </label>
                <br />
                <label><b>生日：</b></label><br />
                @Html.DropDownListFor(m => m.BirthYear, new SelectList(years, "key", "value"), "----")
                <label>年</label>

                @Html.DropDownListFor(m => m.BirthMonth, new SelectList(months), "--")
                <label>月</label>

                @Html.DropDownListFor(m => m.Constellation, new SelectList(constellation, "key", "value"), "--")
                <label>星座</label>
                <br />
                <label><b>关键字：（*使用空格分隔）</b></label><br />
                @Html.DropDownListFor(m => m.First, new SelectList(first, "key", "value"), "--- 一级 ---")
                @Html.ValidationMessageFor(m => m.First)
                @Html.DropDownListFor(m => m.Secend, new SelectList(second, "key", "value"), "--- 二级 ---")
                @Html.TextBoxFor(m => m.KeyWord, new
           {
               placeholder = "自定义关键字，使用空格分隔"
           });
                <br />
                <label><b>自我介绍：</b></label>
                @Html.TextAreaFor(m => m.SelfDescription, new
           {
               @class = "form-control",
               placeholder = "简单的自我介绍下自己吧，不超过255个字"
           });
                <br />
                <button type="submit">提交</button>
            }
        </div>
        <div class="col-6" style="padding:0px 50px 0px 50px">
            <h4><span class="fa fa-question-circle">说明</span></h4>
            <ol>
                <li>头像仅接受jpg/png/gif格式，大小不超过256KB。</li>
                <li>头像图片的建议宽度为300像素左右，过宽或过窄都有可能失真。</li>
                <li>自我介绍的字数不要超过255字。</li>
            </ol>
        </div>
    </div>
</div>
